package com.example.xx.dao;
import com.example.xx.pojo.Article;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface ArticleDao {
    //查双表
    List<Article> cha(Integer id);

    //假删除
    @Update("update article set deleted=1 where id=#{id}")
    int shanchu(Integer id);


    @Insert("insert into article(title,content,cover_img,state,create_user,category_id,create_time) values(#{title},#{content},#{cover_img},#{state},#{create_user},#{category_id},NOW())")
    int tianjia(Article article);
    @Update("update article set title=#{title},content=#{content},cover_img=#{cover_img},state=#{state},category_id=#{category_id},update_time=NOW() where id=#{id}")
    int update(Article article);
}
